home *** CD-ROM | disk | FTP | other *** search
- include 'm16.Util2'
- include 'm16.Stack'
- blanks off
-
-
-
-
- C1OutputToC1Input PROC EXPORT
- DefineStack
- OrigD word
- TheRTL block 3
- TheHandle long
-
- SizeInputs equ 4
-
-
- phd
- tsc
- tcd
- phb ; save dbr
- phk
- plb
-
-
- lda [TheHandle] ; deref the handle
- tax
- ldy #2
- lda [TheHandle],y
- sta TheHandle+2
- stx TheHandle
-
- lda [TheHandle],y ; copy the length into the first word
- sta [TheHandle]
- tax ; and into the x-reg
- sep #$20
- longa off
-
- beq Done ; if length is zero, we are done
-
- More iny ; look ahead 2 for next character
- iny
- lda [TheHandle],y
- dey ; store it where we were
- dey
- sta [TheHandle],y
- iny ; bump y by one
- dex ; dec x by one and continue if not zero
- bne More
-
-
- Done rep #$20
- longa on
-
-
- lda TheRTL
- sta TheRTL+SizeInputs
- lda TheRTL+1
- sta TheRTL+1+SizeInputs
-
- plb ; restore dbr
-
-
- pld
- pla
- pla
-
- rtl
-
- endp
-
-
-
- C1OutputToPString PROC EXPORT
- DefineStack
- OrigD word
- TheRTL block 3
- TheHandle long
-
- SizeInputs equ 4
-
-
- phd
- tsc
- tcd
- phb ; save dbr
- phk
- plb
-
-
- lda [TheHandle] ; deref the handle
- tax
- ldy #2
- lda [TheHandle],y
- sta TheHandle+2
- stx TheHandle
-
- lda [TheHandle],y ; copy the length into the first word
- sta [TheHandle]
- tax ; and into the x-reg
- sep #$20
- longa off
-
- beq Done ; if length is zero, we are done
-
- dey ; start y at 1
-
- More iny ; look ahead 3 for next character
- iny
- iny
- lda [TheHandle],y
- dey ; store it where we were
- dey
- dey
- sta [TheHandle],y
- iny ; bump y by one
- dex ; dec x by one and continue if not zero
- bne More
-
-
- Done rep #$20
- longa on
-
-
- lda TheRTL
- sta TheRTL+SizeInputs
- lda TheRTL+1
- sta TheRTL+1+SizeInputs
-
- plb ; restore dbr
-
-
- pld
- pla
- pla
-
- rtl
-
- endp
-
-
-
- END
-
-